﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace TimePickerTesting
{
    public partial class TemplateTesting : System.Web.UI.Page
    {
        public List<DateTime> DateTimeList
        {
            get
            {
                List<DateTime> list = new List<DateTime>();
                list.Add(DateTime.Now);
                list.Add(DateTime.Now.AddSeconds(30));
                list.Add(DateTime.Now.AddMinutes(30));

                return list;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {


                FormView1.DataSource = DateTimeList;
                FormView1.DataBind();
            }
        }

        protected void btnSwitchToItemViewMode_Click(object sender, EventArgs e)
        {
            FormView1.ChangeMode(FormViewMode.ReadOnly);
            FormView1.DataSource = DateTimeList;
            FormView1.DataBind();
        }

        protected void btnSwitchToEditMode_Click(object sender, EventArgs e)
        {
            FormView1.ChangeMode(FormViewMode.Edit);
            FormView1.DataSource = DateTimeList;
            FormView1.DataBind();
        }

        protected void btnSwitchToInsertMode_Click(object sender, EventArgs e)
        {
            FormView1.ChangeMode(FormViewMode.Insert);
        }
    }
}

